/**
 * @description 存储配置（数据库、redis）
 * @author malin
 */

const { isProd } = require('../utils/env')

let REDIS_CONF = {
    port: 6379,
    host: '127.0.0.1'
}

let MYSQL_CONF = {
    database: 'koa2_weibo_db',
    host: 'localhost',
    port: 3306,
    user: 'root',
    password: '123456',
}

// 线上环境
if(isProd) {
    REDIS_CONF = {
        port: 6379,
        host: '127.0.0.1'
    }
    MYSQL_CONF = {
        database: 'koa2_weibo_db',
        host: 'localhost',
        port: 3306,
        user: 'root',
        password: '123456',
    }
}

module.exports = {
    REDIS_CONF,
    MYSQL_CONF
}
